package com.example.oop;

/**
 * 开发者类 - 实现Workable接口
 * 对比C#的接口实现
 */
public class Developer extends Employee implements Workable {
    private String programmingLanguage;
    private String framework;
    
    public Developer(String name, int age, String employeeId, double salary, 
                    String programmingLanguage, String framework) {
        super(name, age, employeeId, salary);
        this.programmingLanguage = programmingLanguage;
        this.framework = framework;
    }
    
    public Developer(String name, int age, String email, String employeeId, 
                    double salary, String department, String programmingLanguage, 
                    String framework) {
        super(name, age, email, employeeId, salary, department);
        this.programmingLanguage = programmingLanguage;
        this.framework = framework;
    }
    
    // Getter和Setter
    public String getProgrammingLanguage() {
        return programmingLanguage;
    }
    
    public void setProgrammingLanguage(String programmingLanguage) {
        this.programmingLanguage = programmingLanguage;
    }
    
    public String getFramework() {
        return framework;
    }
    
    public void setFramework(String framework) {
        this.framework = framework;
    }
    
    // 实现Workable接口的方法
    @Override
    public void work() {
        System.out.println(getName() + " 正在使用 " + programmingLanguage + 
                          " 和 " + framework + " 进行开发");
    }
    
    @Override
    public String getJobTitle() {
        return "Java开发者";
    }
    
    // 重写父类方法
    @Override
    public void introduce() {
        super.introduce();
        System.out.println("编程语言: " + programmingLanguage);
        System.out.println("框架: " + framework);
        System.out.println("职位: " + getJobTitle());
    }
    
    // 开发者特有方法
    public void debug() {
        System.out.println(getName() + " 正在调试代码...");
    }
    
    public void codeReview() {
        System.out.println(getName() + " 正在进行代码审查...");
    }
    
    // 重写toString方法
    @Override
    public String toString() {
        return "Developer{" +
                "name='" + getName() + '\'' +
                ", age=" + getAge() +
                ", email='" + getEmail() + '\'' +
                ", employeeId='" + getEmployeeId() + '\'' +
                ", salary=" + getSalary() +
                ", department='" + getDepartment() + '\'' +
                ", programmingLanguage='" + programmingLanguage + '\'' +
                ", framework='" + framework + '\'' +
                '}';
    }
} 